#include <bits/stdc++.h>
using namespace std;

struct group
{
    int num;
    vector<string> mes; // Use vector for dynamic allocation
};
bool check(const string& s)
{
    return s.find("bie") != string::npos;
}

int main()
{
    int n;
    cin >> n;
    vector<group> g(n); // Using vector for dynamic memory allocation
    for(int i=0; i<n; i++)
    {
        cin >> g[i].num;
        g[i].mes.resize(g[i].num);
        for(int j=0; j<g[i].num; j++)
        {
            cin >> g[i].mes[j];
        }
    }

    set<string> g0;
    for(int i=0; i<n; i++)
    {
        int count = 0;
        for(int j=0; j<g[i].num; j++)
        {
            if(check(g[i].mes[j]) && g0.find(g[i].mes[j]) == g0.end())
            {
                g0.insert(g[i].mes[j]);
                cout << g[i].mes[j] << endl;
                count++;
            }
        }
        if(count == 0)
        {
            cout << "Time to play Genshin Impact, Teacher Rice!" << endl;
        }
    }
    return 0;
}
